import com.ddmh.minio.Main;
import com.ddmh.minio.factory.MinioClientFactory;
import io.minio.BucketExistsArgs;
import io.minio.MinioClient;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * Minio测试
 *
 * @author brant
 * @since 2024-04-12
 */
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Main.class)
public class MinioTest {

    @Test
    public void testClient() throws Exception {
        MinioClient minioClient = MinioClientFactory.getInstance();
        boolean bucketExists = minioClient.bucketExists(BucketExistsArgs.builder().bucket("img").build());
        log.info("bucketExists: {}", bucketExists);
    }

}
